package ${clazz.pkg};

import static org.junit.Assert.*;

import java.util.*;
import com.xqiapp.biz.bean.*;
import com.xqiapp.biz.service.*;
import com.xqiapp.common.base.bean.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * 
 * ${clazz.interfaceName}接口的测试类
 * 
 * @author mike
 * @date 2016年7月13日
 * @version 0.0.1
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { ${clazz.configPath} })
public class ${clazz.interfaceImplName}Test {
	
	@Autowired
	private ${clazz.interfaceName} ${clazz.declName};
	
	<#list clazz.methods as m>
	@Test
	public void ${m.name}_test(){
		${m.returnType} ${m.returnDecl} = ${clazz.declName}.${m.name}(
		<#list m.argsNames as am>
			<#if "${am_index+1}" != "${m.argSize}" >
	             ${m.argsTypes[am]} ${am},
	       	<#else>
	             ${m.argsTypes[am]} ${am}
	       	</#if>
		</#list>
		);
		assertNotNull(${m.returnDecl});
		<#if "${m.returnDecl}" == "mResults" >
		assertFalse(${m.returnDecl}.isFlag());
		</#if>
	}
	</#list>
	
}
